all: server

date := $(shell date "+%Y-%m-%d--%H:%M:%S")
host := $(shell hostname)
build_version := $(shell git rev-parse HEAD 2> /dev/null)
app_version := $(build_version)
user := $(shell whoami)
tag := $(shell git describe --tags 2> /dev/null)-tag
app_name := Light

server: cmd/server/main.go
	go build -ldflags "-extldflags -static -X github.com/gotomicro/ego/core/eapp.appName=$(app_name) -X github.com/gotomicro/ego/core/eapp.buildVersion=$(app_version)-dirty -X github.com/gotomicro/ego/core/eapp.buildAppVersion=$(build_version)-diry -X github.com/gotomicro/ego/core/eapp.buildStatus=Modified -X github.com/gotomicro/ego/core/eapp.buildTag=$(tag) -X github.com/gotomicro/ego/core/eapp.buildUser=$(user) -X github.com/gotomicro/ego/core/eapp.buildHost=$(host) -X github.com/gotomicro/ego/core/eapp.buildTime=$(date)" light-pi/cmd/server

clean:
	rm -rf ./server
